package com.runjian.rundo.iot.agent.common.network.core;

import java.util.function.BiConsumer;
import java.util.function.Consumer;

import com.runjian.rundo.iot.agent.common.network.core.config.BaseNetworkClientProperties;

import io.netty.channel.Channel;
import io.netty.util.concurrent.Future;
import lombok.extern.slf4j.Slf4j;

/**
 * 基础网关客户端组件
 *
 * @author CaoQingHua
 */
@Slf4j
public abstract class BaseNetworkClient<T extends BaseNetworkClientProperties> implements NetworkClient<T> {

    @Override
    public Future<Void> connection(Consumer<Boolean>... callbacks) {
        return null;
    }

    public abstract Future<Void> channelConnection(BiConsumer<Boolean, Channel>... callbacks);

    @Override
    public void stop() {

    }

    /**
     * 当前连接的配置Id，类似于网关Id
     *
     * @return Tcp配置的Id,类似于网关
     */
    public abstract String getId();

}
